/*
 * FunctionDefinitionInstruction.h
 *
 *  Created on: 22/nov/2010
 *      Author: computer
 */

#ifndef FUNCTIONDEFINITIONINSTRUCTION_H_
#define FUNCTIONDEFINITIONINSTRUCTION_H_
#include "FlowExpression.h"
#include "Pattern.h"

namespace TreeExpression {

class FunctionDefinitionInstruction : public FlowExpression, public Expression_CRTP<FunctionDefinitionInstruction> {
public:
	FunctionDefinitionInstruction(const std::string&);
	FunctionDefinitionInstruction(const FunctionDefinitionInstruction&);
	virtual ~FunctionDefinitionInstruction();

    std::string getName() const;
    void setName(std::string name);

    void addParameter(const PatternRecognition::Pattern<>&);
    void setNameLastPattern(const std::string&);
    std::list< PatternRecognition::Pattern<> > getParameter() const;

    virtual AutoPointer<Expression> eval(CopyPointer<Context>&);
    virtual std::string toString() const;
private:
	std::string name;
	std::list< Pattern<> > listPattern;
};

}

#endif /* FUNCTIONDEFINITIONINSTRUCTION_H_ */
